
static inline int __task_state_match(struct task_struct *p, unsigned int state)
{
    if (READ_ONCE(p->__state) & state)
        return 1;

    if (READ_ONCE(p->saved_state) & state)
        return -1;

    return 0;
}

static inline int task_state_match(struct task_struct *p, unsigned int state)
{
    /*
     * Serialize against current_save_and_set_rtlock_wait_state(),
     * current_restore_rtlock_saved_state(), and __refrigerator().
     */
    //todo guard(raw_spinlock_irq)(&p->pi_lock);

    return __task_state_match(p, state);
}
